{template '_header'}
{template 'merch/common'}
<div class="fui-page page-merch-register">
    <div class="fui-content">

        <img class="regbg" src="{if empty($set['regbg'])}../addons/ewei_shopv2/plugin/merch/template/mobile/default/static/images/regbg.png{else}{php echo tomedia($set['regbg'])}{/if}"/>

        {if !empty($user)}

        {else}

                {if !empty($reg)}

                        {if $reg['status']==-1}

                        <div class="fui-alert fui-alert-danger">
                            <p>您的申请被驳回：</p>
                            <p>{$reg['reason']}</p>
                            <p>您也可以修改信息重新提交</p>
                        </div>

                        {else}
                        <div class="fui-alert fui-alert-warning">
                            <p>您已经提交了信息，请等待我们联系您!</p>
                            <p>您也可以修改信息重新提交</p>
                        </div>
                        {/if}
                {/if}

        <div class="fui-cell-group">
            <div class="fui-cell must ">
                <div class="fui-cell-label">商户名称</div>
                <div class="fui-cell-info"><input type="text" class="fui-input" id="merchname" placeholder="商户名称" value="{$reg['merchname']}"/></div>
            </div>
            <div class="fui-cell must ">
                <div class="fui-cell-label">主营项目</div>
                <div class="fui-cell-info"><input type="text" class="fui-input" id="salecate" placeholder="例如鞋帽, 化妆品等" value="{$reg['salecate']}"/></div>
            </div>
            <div class="fui-cell ">
                <div class="fui-cell-label">简单介绍</div>
                <div class="fui-cell-info"><textarea id="desc" placeholder="简单介绍下商户">{$reg['desc']}</textarea></div>
            </div>

        </div>
        <div class="fui-cell-group">
            <div class="fui-cell must ">
                <div class="fui-cell-label">联系人</div>
                <div class="fui-cell-info"><input type="text" class="fui-input" id="realname" placeholder="您的称呼" value="{$reg['realname']}"></div>
            </div>
            <div class="fui-cell must ">
                <div class="fui-cell-label">手机号</div>
                <div class="fui-cell-info"><input type="tel" class="fui-input" id="mobile" placeholder="您的手机号" value="{$reg['mobile']}"/></div>
            </div>
            <div class="fui-cell-tip">请仔细填写联系方式，保证我们能尽快联系到您~</div>

        </div>

                {if $template_flag}

                {template 'diyform/formfields'}

                {/if}


                {if $set['open_protocol'] == 1}
                <div class="fui-cell-group">
                    <div class="fui-cell small ">
                        <div class="fui-cell-info">

                            <label class="checkbox-inline">
                                <input type="checkbox" class="fui-checkbox-primary" id="agree" {if !empty($reg)}checked{/if}/> 我已经阅读并了解了<a id="btn-apply" style="color:#337ab7;">【{$apply_set['applytitle']}】</a>。
                            </label>

                        </div>
                    </div>

                </div>
                {/if}

                <a class="btn btn-warning btn-submit block"> {if empty($reg)}立即申请入驻{else}重新提交申请{/if}</a>
        {/if}

        <div class="pop-apply-hidden" style="display: none;">
            <div class="verify-pop pop">
                <div class="close"><i class="icon icon-roundclose"></i></div>
                <div class="qrcode">
                    <div class="inner">
                        <div class="title">{$set['applytitle']}</div>
                        <div class="text">{$set['applycontent']}</div>
                    </div>
                    <div class="inner-btn" style="padding: 0.5rem">
                        <div class="btn btn-warning" style="width: 100%; margin: 0">我已阅读</div>
                    </div>
                </div>
            </div>
        </div>

    </div>
    <script language="javascript">
        require(['../addons/ewei_shopv2/plugin/merch/static/js/register.js'], function (modal) {
            modal.init({php echo json_encode($apply_set)});
        })
    </script>
</div>
{template '_footer'}
